<?php
class CategoryDropDownListColumn extends CDataColumn {
    public $rootId = 0;
    public $locale = 'en_us';
    /**
     * Renders the filter cell content.
     * This method will render the {@link filter} as is if it is a string.
     * If {@link filter} is an array, it is assumed to be a list of options, and a dropdown selector will be rendered.
     * Otherwise if {@link filter} is not false, a text field is rendered.
     * @since 1.1.1
     */
    protected function renderFilterCellContent()
    {
        if($this->filter!==false && $this->grid->filter!==null && $this->name!==null)
        {
            Yii::app()->controller->widget('CategoryDropDownList', array(
                'model'=>$this->grid->filter,
                'attribute'=>$this->name,
                'rootId' => $this->rootId,
                'locale' => $this->locale,
                'includeRoot'=>false,
                'htmlOptions'=>array(
                    'prompt'=>'-- All --',
                ),
            ));
        }
        else
            parent::renderFilterCellContent();
    }
}